#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
    chdir("/home/chineseperson04/CSDN/Process_Concept");

    FILE* fp = fopen("code.txt","w");
    if(fp == NULL)
        return 0;
    fclose(fp);

    int i = 0;
    while(i <= 100)
    {
        int pid = getpid();
        int ppid = getppid();
        printf("我已经是一个进程了, 我的进程ID是:%d, 我的父进程ID是:%d\n",pid,ppid);
        i++;
        sleep(1);
    }

    return 0;
}
